package array;

import java.util.Arrays;
//todo kmp
public class RotateString796 {
    public boolean rotateString(String s, String goal) {
        if(s.length()!=goal.length()){
            return false;
        }
        for (int i = 1; i <= s.length(); i++) {
            if(s.substring(0,0+i).equals(goal.substring(goal.length()-i))&&
                s.substring(0+i).equals(goal.substring(0,goal.length()-i))){
                return true;
            }
        }
        return false;
    }
}
